home *** CD-ROM | disk | FTP | other *** search
/ Web Star/List Star - Eve…he Ultimate Internet Site / StarNine Internet Pubisher (Web Star and List Star)(StarNine)(1995).iso / ListSTAR™ / Tools and Enhancments / Paging with ListSTAR / PageNOW! / PageNOW! Send Page v1.0 < prev    next >
Encoding:
Text File  |  1995-08-04  |  2.9 KB  |  67 lines  |  [TEXT/ToyS]

  1. -----------------------------------------------------------------------
  2. -- StarNine Technologies, Inc., hereby disclaims all copyright interest
  3. -- in the following source code written by Joshua D. Baer.
  4. -- 
  5. -- This source code is free and has been placed into the public domain.
  6. -- You can redistribute it, modify it (including these comments) and/or
  7. -- create derivative works from it as you see fit.
  8. --
  9. -- This source code is made available in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. -----------------------------------------------------------------------
  13. --Place this script in the folder with the same name as the service you just created
  14. --(ie. Hard Drive->ListSTAR/SMTP->Services-><Service Name>).
  15. --Change the value for the ServiceName variable to be the same as the name of your Service.
  16.  
  17. set ServiceName to "<your Service Name>"
  18.  
  19. --End of Configuration Area
  20.  
  21. set intro to "Sending page to: "
  22. set bodyintro to "Body: "
  23. --max length of pages
  24. set maxlength to 255
  25.  
  26. --the file which contains the body of the page
  27. set strStart to path to me
  28. set strListSTARpath to text from character 1 to character -16 of (strStart as string)
  29. set thefile to strListSTARpath & "Services:" & ServiceName & ":Outgoing Page"
  30. --the email address of the service
  31. set serviceEmailAddress to "pagenow@thelorax.starnine.com"
  32.  
  33. tell application "PageNOW!™"
  34.     activate
  35.     
  36.     --DEBUG CODE
  37.     tell application "ListSTAR Server" to StarNine Log "constructing page" Log Level Debug
  38.     
  39.     --read in body of message
  40.     try
  41.         set textsource to open for access file (thefile) --open the file with the digest in it
  42.         set thetext to read textsource from 1 -- read the entire file into theBody
  43.         close access textsource --close the file
  44.     on error errString number errNum
  45.         return -1
  46.         display dialog errString & " " & errNum
  47.     end try
  48.     
  49.     --check to see if body is too long, if so truncate
  50.     set theheader to (count of characters in (intro & s9mailsubject & bodyintro)) + 1
  51.     if ((count of characters in thetext) + theheader) is greater than maxlength then set thetext to (characters 1 through (maxlength - theheader) of thetext)
  52.     
  53.     --if subscriber is known, page him
  54.     if ((s9mailsubject is in (subscriber names)) or (s9mailsubject is in (group names))) then
  55.         tell application "ListSTAR Server" to StarNine Log "sending page" Log Level Debug
  56.         send page thetext as string to s9mailsubject as string
  57.     else --else subscriber is not known, so reply and say so
  58.         tell application "ListSTAR Server"
  59.             StarNine Send ¬
  60.                 "PageNOW!" To s9SenderEmailAddress ¬
  61.                 Subject s9mailsubject & ¬
  62.                 " is not a known subscriber or group" Body s9mailsubject & " is not a known subscriber or group.  For a complete listing, send mail to \"" & serviceEmailAddress & "\" with the word \"subscribers\" in the subject." & return & return & "Original text of page follows:" & return & return & thetext
  63.         end tell
  64.     end if
  65. end tell
  66.  
  67. return 0